<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>一元夺宝</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">一元夺宝</h1>
		</header>
		<div class="mui-content fs_xl" style="padding-bottom: 3em;">
			<!--<div class="hq_show fs_xl">
				<ul>
					<foreach name="lists_end" item="vo" key="k">
					<li class="cls">
						<div class="hq_lt">
							<img src="{$vo[goods_id]|goods_thum_images=400,400}" />
						</div>
						<div class="hq_rt fs_m">
							<p class="fs_m">{$vo.title}</p>
							<p class="fs_m"><span>{$vo.nickname}成功夺宝</span></p>
						</div>
					</li>
					</foreach>
				</ul>
			</div>-->
			<a class="mui-icon mui-icon-help fs_xi" href="/Mobile/User/article/id/3.html" style="display: block;line-height: 2em;text-align: center;color: #b9b9b9;"><span class="fs_s">夺宝规则</span></a>
			<div class="db_list" style="margin-top: 0;">
				<ul>
					<foreach name="lists" item="vo" key="k">
						<li class="cls">
							<div class="list_lt">
								<a href="{:U('Mobile/Goods/indianaInfo',array('id'=>$vo.id))}"><img src="{$vo[goods_id]|goods_thum_images=400,400}" /></a>
							</div>
							<div class="list_rt cls">
								<p class="list_tit fs_l">{$vo.title}</p>
								<p class="list_time fs_m" data-time="{$vo.end_time|date='Y/m/d H:i:s',###}"><span class="li_d" id="li_d">00</span>天<span class="li_h" id="li_h">00</span>时<span class="li_m" id="li_m">00</span>分<span class="li_s" id="li_s" style="display: none;">00</span></p>
								<div class="db_jdt fs_xl">
									<span class="span_1 fs_xs">总共<em class="zs_num">{$vo.goods_num}</em>还剩<em class="sy_num">{$vo.stock_num}</em>夺宝</span>
									<span class="span_2"><em></em></span>
								</div>
								<div class="db_lj_btn">
									<a href="{:U('Mobile/Goods/indianaInfo',array('id'=>$vo.id))}">立即夺宝</a>
								</div>
							</div>
						</li>
					</foreach>
				</ul>
			</div>
			<div class="db_nav fs_xl">
				<a class="active fs_m" href="{:U('Mobile/Goods/indianaList')}">
					<p class="mui-icon iconfont icon-yiun fs_i"></p>
					<p class="fs_xs">一元夺宝</p>
				</a>
				<a class="fs_m" href="{:U('Mobile/Goods/indianaAfter')}">
					<p class="mui-icon iconfont icon-yuanun fs_i"></p>
					<p class="fs_xs">夺宝预告</p>
				</a>
				<a class="fs_m" href="{:U('Mobile/Goods/indianaBefore')}">
					<p class="mui-icon iconfont icon-duoun fs_i"></p>
					<p class="fs_xs">往期夺宝</p>
				</a>
				<a href="{:U('Mobile/User/indiana')}">
					<p class="mui-icon iconfont icon-baoun fs_i"></p>
					<p class="fs_xs">我的夺宝</p>
				</a>
			</div>
		</div>
		<script type="text/javascript">
			mui.init();
			function show_time(T1,id1,id2,id3,id4) {
				var time_start = new Date().getTime(); //设定当前时间
				var time_end = new Date(T1).getTime(); //设定目标时间
				// 计算时间差 
				var time_distance = time_end - time_start;// 天
				if(time_distance>0){
					var int_day = Math.floor(time_distance / 86400000)
					time_distance -= int_day * 86400000;// 时
					var int_hour = Math.floor(time_distance / 3600000)
					time_distance -= int_hour * 3600000;// 分
					var int_minute = Math.floor(time_distance / 60000)
					time_distance -= int_minute * 60000;// 秒 
					var int_second = Math.floor(time_distance / 1000)
					if(int_day < 10) {
						int_day = "0" + int_day;
					}// 时分秒为单数时、前面加零
					if(int_hour < 10) {
						int_hour = "0" + int_hour;
					}
					if(int_minute < 10) {
						int_minute = "0" + int_minute;
					}
					if(int_second < 10) {
						int_second = "0" + int_second;
					}
					$(id1).html(int_day);
					$(id2).html(int_hour);
					$(id3).html(int_minute);
					$(id4).html(int_second);// 显示时间 				
//					setTimeout("show_time()", 1000);// 设置定时器
				}
			}
//			var powerpointindex = 0;
//			var imgNum = $(".hq_show li").length;
//			function change_index_powerpoint() {
//				if(powerpointindex >= imgNum){
//					powerpointindex = 0;
//				}
//				$(".hq_show ul li").eq(powerpointindex).css("display", "block").siblings().slideUp();
//				powerpointindex++;
//			}
			function sdsd(){
				$(".list_time").each(function(){
      				var t1=$(this).attr("data-time");
      				var li_day=$(this).find(".li_d");
      				var li_hour=$(this).find(".li_h");
      				var li_mim=$(this).find(".li_m");
      				var li_s=$(this).find(".li_s");
      				show_time(t1,li_day,li_hour,li_mim,li_s);
      			});//遍历页面倒计时，显示倒计时
      		}
			$(function(){
//				change_index_powerpoint();
//    			window.setInterval("change_index_powerpoint()", 5000);
      			setInterval("sdsd()",1000);
      			$(".db_jdt").each(function(){
      				var sy_num=$(this).find(".sy_num").text();
      				var zs_num=$(this).find(".zs_num").text();
      				var merc=Math.round((zs_num-sy_num)/zs_num * 10000) / 100.00 + "%";
      				$(this).find(".span_2 em").width(merc);
      			});//遍历页面进度条宽度
      			$(".db_nav a").click(function(){
      				$(this).addClass("active").siblings().removeClass("active");
      			})
			})
		</script>
	</body>

</html>